import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class E5 {

  /**
   * @param args
   */
  public static void main(String[] args) {
    String text = "http://www.devbg.org/forum/index.php";
    Pattern pattern = Pattern.compile("(\\w+)://([\\w\\.]+)([\\w\\./]+)");
    Matcher matcher = pattern.matcher(text);
    while (matcher.find()) {
      System.out.println("protocol " + matcher.group(1));
      System.out.println("server " + matcher.group(2));
      System.out.println("resource " + matcher.group(3));
    }
  }
}
